# Maintainer: jcsiv <siviter dot jamie at gmx dot co dot uk>
# Contributor: Riccardo Berto <riccardobrt@gmail.com>
# Contributor: vbmithr
# Contributor: Flamelab <panosfilip at gmail dot com>
# Contributor: Dan Ziemba <zman0900@gmail.com>

pkgname=xf86-video-ati-git
_realpkgname=xf86-video-ati
pkgver=7.5.0.r75.gafab783
pkgrel=1
pkgdesc="X.org ati video driver. Git version"
arch=('i686' 'x86_64')
url="http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/"
provides=("${_realpkgname}")
depends=('libdrm>=2.4.41' 'libsystemd' 'ati-dri') #ati-dri is mesa-dri-git !! and it's also ABI dependent so fix that in it!
makedepends=('git' 'xorg-server-devel' 'X-ABI-VIDEODRV_VERSION>=18' 'X-ABI-VIDEODRV_VERSION<=19') #the latter is provided by xorg-server 1.17
conflicts=('xorg-server<1.16.0' 'X-ABI-VIDEODRV_VERSION<18' 'X-ABI-VIDEODRV_VERSION>=20' 'xf86-video-ati')
license=('custom')
install=xf86-video-ati-git.install

source=('xf86-video-ati::git://anongit.freedesktop.org/xorg/driver/xf86-video-ati#branch=master'
"$install"
)
sha512sums=('SKIP'
            'b62a7a69a5bf2a43e7e9401b2f8402df3a19cdfc5d53247db040702bf03d985e4675898c37cf2a98e9d483eeac1e7c293bc4ce616d6ecffe3ee67e22d7c0edbd')

build() {
  cd "${srcdir}/xf86-video-ati"
    
  ./autogen.sh --prefix=/usr \
    --enable-glamor=no \

  make -j4
}

pkgver() {
  cd "${srcdir}/xf86-video-ati"
  echo "$(git describe --long | sed -r 's/^xf86-video-ati-//;s/([^-]*-g)/r\1/;s/-/./g')"
}


package() {
  cd "${srcdir}/xf86-video-ati"
  
  make DESTDIR="${pkgdir}" install 
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}

